@model EIMS.Models.Customer

@{
    ViewData["Title"] = "编辑客户";
}

<div class="container-fluid px-4">
    <h1 class="mt-4">@ViewData["Title"]</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Customer" asp-action="Index">客户管理</a></li>
        <li class="breadcrumb-item active">编辑客户</li>
    </ol>

    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-edit me-1"></i>
            编辑客户信息
        </div>
        <div class="card-body">
            <form asp-action="Edit">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input type="hidden" asp-for="Id" />
                <input type="hidden" asp-for="CreatedAt" />
                
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group mb-3">
                            <label asp-for="CustomerNumber" class="control-label"></label>
                            <input asp-for="CustomerNumber" class="form-control" />
                            <span asp-validation-for="CustomerNumber" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Name" class="control-label"></label>
                            <input asp-for="Name" class="form-control" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Type" class="control-label"></label>
                            <select asp-for="Type" class="form-select" asp-items="ViewBag.Types"></select>
                            <span asp-validation-for="Type" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="CreditRating" class="control-label"></label>
                            <select asp-for="CreditRating" class="form-select" asp-items="ViewBag.CreditRatings"></select>
                            <span asp-validation-for="CreditRating" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Status" class="control-label"></label>
                            <select asp-for="Status" class="form-select" asp-items="ViewBag.Statuses"></select>
                            <span asp-validation-for="Status" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group mb-3">
                            <label asp-for="ContactPerson" class="control-label"></label>
                            <input asp-for="ContactPerson" class="form-control" />
                            <span asp-validation-for="ContactPerson" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="PhoneNumber" class="control-label"></label>
                            <input asp-for="PhoneNumber" class="form-control" />
                            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Email" class="control-label"></label>
                            <input asp-for="Email" class="form-control" />
                            <span asp-validation-for="Email" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Fax" class="control-label"></label>
                            <input asp-for="Fax" class="form-control" />
                            <span asp-validation-for="Fax" class="text-danger"></span>
                        </div>
                        <div class="form-group mb-3">
                            <label asp-for="Website" class="control-label"></label>
                            <input asp-for="Website" class="form-control" />
                            <span asp-validation-for="Website" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="form-group mb-3">
                    <label asp-for="Address" class="control-label"></label>
                    <input asp-for="Address" class="form-control" />
                    <span asp-validation-for="Address" class="text-danger"></span>
                </div>
                
                <div class="form-group mb-3">
                    <label asp-for="Remarks" class="control-label"></label>
                    <textarea asp-for="Remarks" class="form-control" rows="3"></textarea>
                    <span asp-validation-for="Remarks" class="text-danger"></span>
                </div>
                
                <div class="form-group">
                    <input type="submit" value="保存" class="btn btn-primary" />
                    <a asp-action="Index" class="btn btn-secondary">返回列表</a>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 